<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let x = 'huhu o  ohu hu '
        let part=/hu/g
        let match = x.match(part)
        console.log(match)
        //g为全局匹配，i为忽略大小写
    </script>
</body>
</html>